package com.highspeed.bdk;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

import java.util.Map;

@Controller
public class PageController {

    @RequestMapping(value = "deploy_topology_library")
    public String deployTopologyLibrary2(HttpServletRequest request, Map<String, Object> map) {
        map.put("id1", "1");
        return "deployTopologyLibrary";
    }

    //物理视图绑定
    @RequestMapping(value = "physical_view_bindors")
    public String physicalViewBindors(HttpServletRequest request, Map<String, Object> map) {
        String id = request.getParameter("id");
        map.put("id", id);
        return "physicalViewBindors";
    }

    //用户常用命令库
    @RequestMapping(value = "commonCMD")
    public String commonCMD(HttpServletRequest request, Map<String, Object> map) {
        String id = request.getParameter("id");
        map.put("id", id);
        return "commonCMD";
    }

    //用户通用命令库
    @RequestMapping(value = "generalCMD")
    public String generalCMD(HttpServletRequest request, Map<String, Object> map) {
        String id = request.getParameter("id");
        map.put("id", id);
        return "generalCMD";
    }

    //逻辑应用预案库
    @RequestMapping(value = "logical_application_library")
    public String logicalApplicationLibrary(HttpServletRequest request, Map<String, Object> map) {
        String id = request.getParameter("id");
        map.put("id", id);
        return "logicalApplicationLibrary";
    }

    //逻辑链接绑定
    @RequestMapping(value = "logical_link_bindors")
    public String logicalLinkBindors(HttpServletRequest request, Map<String, Object> map) {
        String id = request.getParameter("id");
        map.put("id", id);
        return "logicalLinkBindors";
    }

    //逻辑监控
    @RequestMapping(value = "logical_monitors")
    public String logicalMonitors(HttpServletRequest request, Map<String, Object> map) {
        String id = request.getParameter("id");
        map.put("id", id);
        return "logicalMonitors";
    }

    //新建主机和板卡
    @RequestMapping(value = "new_machines_and_boardors")
    public String newMachinesAndBoardors(HttpServletRequest request, Map<String, Object> map) {
        String id = request.getParameter("curId");
        map.put("id", id);
        return "newMachinesAndBoardors";
    }

    //新建单元
    @RequestMapping(value = "newCpus")
    public String newCpus(HttpServletRequest request, Map<String, Object> map) {
        String id = request.getParameter("id");
        map.put("id", id);
        String pId = request.getParameter("pId");
        map.put("pId", pId);
        String topId = request.getParameter("topId");
       // System.out.println(topId);
        map.put("topId", topId);
        return "newCpus";
    }

    //物理链接绑定
    @RequestMapping(value = "physical_link_bindors")
    public String physicalLinkBindors(HttpServletRequest request, Map<String, Object> map) {
        String id = request.getParameter("id");
        map.put("id", id);
        return "physicalLinkBindors";
    }

    //物理监控
    @RequestMapping(value = "physical_monitors")
    public String physicalMonitors(HttpServletRequest request, Map<String, Object> map) {
        String id = request.getParameter("id");
        map.put("id", id);
        return "physicalMonitors";
    }

    //物理监控2
    @RequestMapping(value = "physical_monitors2")
    public String physicalMonitors2(HttpServletRequest request, Map<String, Object> map) {
        String id = request.getParameter("id");
        map.put("id", id);
        return "physicalMonitors2";
    }

    //物理拓扑全局预览
    @RequestMapping(value = "physical_top_all_view")
    public String physicalTopAllView(HttpServletRequest request, Map<String, Object> map) {
        String id = request.getParameter("id");
        map.put("id", id);
        String returnUrl = request.getParameter("returnUrl");
        map.put("returnUrl", returnUrl);
        String name = request.getParameter("name");
        map.put("phyname", name);
        return "physicalTopAllView";
    }

    //物理拓扑文件库
    @RequestMapping(value = "physical_topology_library")
    public String physicalTopologyLibrary(HttpServletRequest request, Map<String, Object> map) {
        String id = request.getParameter("id");
        map.put("id", id);
        return "physicalTopologyLibrary";
    }
}
